package leetcode_字符串._05字符串的反转;

import java.util.Arrays;
import java.util.Collections;

/**
 * 翻转字符串里的单词
 */
public class _151 {

    public String reverseWords(String s) {
        s = s.trim();
        String[] split = s.split("\\s+");
        Collections.reverse(Arrays.asList(split));
        return String.join(" ", split);
    }
}
